﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.Core.Metadata.Edm;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PharmacyBussinesEntities;

namespace PharmacyRepositoy.Mapping
{
    public class LaboratorioMap:EntityTypeConfiguration<Laboratorio>
    {
        public LaboratorioMap()
        {
            this.HasKey(p => p.Id);

            this.Property(p => p.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(p => p.Nombre)
                .IsRequired()
                .HasMaxLength(150);

            this.Property(p => p.Descripcion)
                .IsOptional()
                .HasMaxLength(100);
            this.ToTable("LABORATORIO");
        }
    }
}
